<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #template {
        display: none;
      }
    </style>
  </head>
  <body>
    <!-- 1. 动态的key -->
    <!-- <h1 :key="keys"></h1> -->

    <!-- 2.  vue:before-update-->
    <!-- <h1 @vue:before-update="() => {console.log('更新前')}">1123123</h1> -->

    <!-- 3. 自定义指令 & 存在孩子 -->
    <!-- <h1 v-xx="xx">xx</h1> -->

    <!-- 4. keep-alive & 存在孩子 -->
    <!-- <keep-alive> xxx </keep-alive> -->
    <div id="template">
      <div>
        <h1 :name="count">{{count}}</h1>
        <suspense>
          <template #default>
              default
          </template>
          <template #fallback>
            default
        </template>
        </suspense>
      </div>
    </div>
    <div id="app"></div>
    <script src="../../../../packages/vue/dist/vue.global.js"></script>

    <script>
      const { createApp, ref } = Vue

      const template = document.querySelector('#template')?.innerHTML
      const App = {
        setup() {
          const count = ref(2)
          const add = () => count.value++
          return {
            count,
            add
          }
        },
        template
      }

      createApp(App).mount('#app')
    </script>
  </body>
</html>
